package com.study.kafka.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @description: 消费者
 * @author: liujiawei
 * @create: 2019-04-18 15:02
 **/
@Component
public class Consumer {

    @KafkaListener(topics = {"hello"}, groupId = "hello")
    public void listen(ConsumerRecord record) {
        System.out.printf("topic = %s, offset = %d, value = %s \n", record.topic(), record.offset(), record.value());
    }
}
